package customer

import (
	"counter-help/admin/server/middleware"
	"github.com/gin-gonic/gin"
)

type CusOrderRouter struct{}

// InitCusOrderRouter 初始化 cusOrder表 路由信息
func (s *CusOrderRouter) InitCusOrderRouter(Router *gin.RouterGroup, PublicRouter *gin.RouterGroup) {
	// TODO: PublicRouter改为Router
	cusOrderRouter := PublicRouter.Group("cusOrder").Use(middleware.OperationRecord())
	cusOrderRouterWithoutRecord := PublicRouter.Group("cusOrder")
	cusOrderRouterWithoutAuth := PublicRouter.Group("cusOrder")
	{
		cusOrderRouter.POST("createCusOrder", cusOrderApi.CreateCusOrder)             // 新建cusOrder表
		cusOrderRouter.POST("filteredOrders", cusOrderApi.FilterCusOrders)            // 获取所有订单
		cusOrderRouter.DELETE("deleteCusOrder/:ID", cusOrderApi.DeleteCusOrder)       // 删除cusOrder表
		cusOrderRouter.DELETE("deleteCusOrderByIds", cusOrderApi.DeleteCusOrderByIds) // 批量删除cusOrder表
		cusOrderRouter.PUT("updateCusOrder", cusOrderApi.UpdateCusOrder)              // 更新cusOrder表
		cusOrderRouter.GET("getAllCusOrders", cusOrderApi.GetAllCusOrders)            // 获取所有订单
		cusOrderRouter.GET("getCusOrdersByUserID", cusOrderApi.GetCusOrdersByUserID)  // 获取所有订单
		cusOrderRouter.GET("findCusOrder", cusOrderApi.FindCusOrder)                  // 根据ID获取cusOrder表
	}
	{
		cusOrderRouterWithoutRecord.GET("getCusOrderList", cusOrderApi.GetCusOrderList) // 获取cusOrder表列表
	}
	{
		cusOrderRouterWithoutAuth.GET("getCusOrderPublic", cusOrderApi.GetCusOrderPublic) // 获取cusOrder表列表
	}
}
